//
//  AllenLandingViewController.m
//  自做商城项目
//
//  Created by allenL on 2017/6/21.
//  Copyright © 2017年 tam. All rights reserved.
//

#import "AllenLandingViewController.h"
#import "AllenThirdLandinView.h"    //第三方登录view
#import "AllenLangdinPutView.h" //用户名密码输入view
#import "AllenlandinNextViewController.h"//注册页面下一步页面
@interface AllenLandingViewController ()

@property (strong, nonatomic) AllenLangdinPutView *landingView;  /** 输入view*/
@property (strong, nonatomic) AllenThirdLandinView *thirdLoginView;  /** 第三方登录view*/

@end

@implementation AllenLandingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = MainColor;
    self.edgesForExtendedLayout = 0;
    self.title = @"注册";
//登录

    [self addController];
 
}

- (void)addController{
    [self.view addSubview: self.landingView];
    [self.view addSubview:self.thirdLoginView];
    __weak typeof (self) weakSelf = self;
    [_landingView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(@230);
        make.left.right.top.equalTo(weakSelf.view);
    }];
    [_thirdLoginView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakSelf.landingView.mas_bottom);
        make.left.right.equalTo(weakSelf.view);
        make.height.equalTo(@85);
    }];



}


- (AllenLangdinPutView *)landingView{
    if (!_landingView) {
        _landingView = [[AllenLangdinPutView alloc]init];
        __weak typeof (self) weakSelf = self;
        _landingView.nextBlock = ^(NSDictionary *dic){
            AllenlandinNextViewController *next = [[AllenlandinNextViewController alloc]init];
            [weakSelf.navigationController pushViewController:next animated:YES];
            next.userMessageDic = dic;
        };
    }
    return _landingView;


}

- (AllenThirdLandinView *)thirdLoginView{
    if (!_thirdLoginView) {
        _thirdLoginView = [[AllenThirdLandinView alloc]init];
    }
    return _thirdLoginView;

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
